<template>
  <button @click="increase">+</button>
  <button @click="decrease">-</button>

  <input type="text" v-model.number="num" />
  <button @click="addNum">addNum</button>
</template>

<script>
export default {
  data() {
    return {
      num: 0
    }
  },
  emits: ['increase', 'decrease', 'addNum'],
  methods: {
    increase() {
      this.$emit('increase')
    },
    decrease() {
      this.$emit('decrease')
    },
    addNum(){
      this.$emit('addNum', this.num)
    }
  }
}
</script>

<style scoped></style>
